﻿using Authentication.Configuration;
using Authentication.Model.Model;
using Common.Data.Extensions;
using System.Data.Entity.ModelConfiguration;

namespace Authentication.Data.DBConfig
{
    public class PasswordAuditConfiguration : DBConfig<AccountPasswordAudit>
    {
        public PasswordAuditConfiguration()
            : base(SystemConfiguration.Schema, SystemConfiguration.NamingType, SystemConfiguration.TABLE_PREFIX)
        {
            HasKey(x => new { x.ApplicationKey, x.Id });
            Property(c => c.Id).IsRequired();
            Property(c => c.UserName).IsRequired().HasMaxLength(50);
            Property(c => c.Password).IsRequired().HasMaxLength(128);
            Property(c => c.CreationDate).IsRequired();
            Property(c => c.Active).HasMaxLength(1);
        }
    }
}
